package cn.swust.designpatternlearningplatform.dao;

import cn.swust.designpatternlearningplatform.dao.sql.StudentTrainingPaperDaoSql;
import cn.swust.designpatternlearningplatform.domain.dto.StudentPersonalTrainingPaperDto;
import cn.swust.designpatternlearningplatform.domain.entity.TrainingPaper;
import cn.swust.designpatternlearningplatform.domain.entity.TrainingPaperConceteContent;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface StudentTrainingPaperDao {
    @InsertProvider(type = StudentTrainingPaperDaoSql.class,method = "insertTrainingPaper")
    void insertTrainingPaper(TrainingPaper trainingPaper);
    @Results(value = {
            @Result(property = "paperNumber",column = "paper_number"),
            @Result(property = "paperName",column = "paper_name"),
    })
   @SelectProvider(type = StudentTrainingPaperDaoSql.class,method = "getAllTrainingPaper")
    List<StudentPersonalTrainingPaperDto> getAllTrainingPaper(String studentNumber);
//    @Results(value = {
//            @Result(property = "paperNumber",column = "paper_number"),
//            @Result(property = "topicId",column = "topic_id"),
//            @Result(property = "ownAnswer",column = "own_answer"),
//            @Result(property = "isRight",column = "is_right"),
//            @Result(property = "id",column = "id"),
//    })
//    @SelectProvider(type = StudentTrainingPaperDaoSql.class,method = "getTrainingPaperContent")
//    List<TrainingPaperConceteContent> getTrainingPaperContent(String paperNumber);
    @InsertProvider(type = StudentTrainingPaperDaoSql.class,method = "addPaperInformation")
    void addPaperInformation(Integer topicId, String uuid, String studentNumber);
    @SelectProvider(type = StudentTrainingPaperDaoSql.class,method = "getTopicId")
    List<Integer> getTopicId(String paperNumber, String studentNumber);
   @SelectProvider(type = StudentTrainingPaperDaoSql.class,method = "getOwnAnswer")
    String getOwnAnswer(String paperNumber, Integer integer,String studentNumber);
    @SelectProvider(type = StudentTrainingPaperDaoSql.class,method = "getTrainingPaperTopicId")
    List<Integer> getTrainingPaperTopicId(String testId, String number);
}
